package com.ws.entity;

import lombok.Data;

/**
 * @author 王硕
 * @version jdk21
 * @className Rect
 * @description
 * @date 2024/11/7 21:54
 */
@Data
public class Rect {
    private double length;
    private double width;

    public Rect(double length, double width) {
        this.length = length;
        this.width = width;
    }

    // 求周长
    public double getPerimeter() {
        return 2 * (length + width);
    }

    // 求面积
    public double getArea() {
        return length * width;
    }
}
